package models

import "gorm.io/gorm"

type Active struct {
	gorm.Model
	Name      string  `gorm:"type:varchar(150);not null;commit:'活动名称'"`
	Price     float64 `gorm:"type:decimal(10,2);not null;commit:'价格'"`
	Stock     int64   `gorm:"type:int;not null;commit:'活动数量'"`
	Process   int     `gorm:"type:int;not null;commit:'成团进度'"`
	Countdown string  `gorm:"type:varchar(150);not null;commit:'倒计时'"`
	Status    int     `gorm:"type:int;not null;commit:'0-进行中,1-结束'"`
}

func (a *Active) ActiveAdd() error {
	return DB.Debug().Create(&a).Error
}
